//
//  ZMSearchBar.swift
//  LoveBeen
//
//  Created by pg on 2017/8/8.
//  Copyright © 2017年 pg. All rights reserved.
//

import UIKit

class ZMSearchBar: UISearchBar {

    override init(frame: CGRect) {
        super.init(frame: frame)
        
      
    }
    override func layoutSubviews() {
        super.layoutSubviews()
        let textfield: UITextField = self.value(forKey: "_searchField") as! UITextField
        textfield.borderStyle = UITextBorderStyle.none
        textfield.backgroundColor = UIColor(white: 0.9, alpha: 1)
        textfield.layer.cornerRadius = 5
        textfield.layer.masksToBounds = true
        // textfield.leftViewMode = UITextFieldViewMode.never
        textfield.setValue(UIColor.lightGray, forKeyPath: "_placeholderLabel.textColor")

    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
